export default {
  components: {
    check: () =>
      import('../../../socical/socialCheck/check.vue')
  },
  data() {
    return {
      company: {
        name: '',
        createTime: [],
        begintime: '',
        endtime: ''
      },
      unMatchData: [],
      page: {
        total: 0,
        pageNum: 1,
        pageSize: 10
      },
      uploadForm: {
        accname: '',
        accessoryid: '',
        filecontent: '',
        updownmark: '1'
      },
      dialogVisible: false,
      loading: false,
      checkFlag: false,
      companyname: "",
      companyid: "",
      imgbase64: ""
    }
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      if (this.company.begintime && this.company.endtime && Date.parse(this.company.begintime) > Date.parse(this.company.endtime)) {
        this.$message({
          message: "结束时间不能早于开始时间",
          type: "warning"
        });
        return;
      }
      this.loding = true;
      // if (this.company.begintime && this.company.endtime) {
      //     // this.company.begintime = this.company.createTime[0];
      //     // this.company.endtime = this.company.createTime[1]
      // } else {
      //     this.company.begintime = '';
      //     this.company.endtime = '';
      // }
      let obj = {
        companyname: this.company.name,
        begintime: this.company.begintime,
        endtime: this.company.endtime,
        pagenum: this.page.pageNum,
      }
      this.$axios.post('/app/v1/platform/recharge/offlineList', obj).then(resp => {
        if (resp.data.message === 'success.') {
          this.unMatchData = resp.data.data.list;
          this.page.total = parseInt(resp.data.data.totalnum);
          this.loading = false;
        }
      })
    },
    SearchInfo() {
      this.page.pageNum = 1;
      this.getData();
    },
    CurrentChange(val) {
      this.page.pageNum = val;
      this.getData();
    },
    LookInfo(row) {
      this.uploadForm.accessoryid = row.accessoryid
      this.$axios.post('/system/v1/common/upAndDown', this.uploadForm).then(res => {
        this.imgbase64 = res.data.data.filecontent;
      });
      this.dialogVisible = true;
    },
    showCompanyInfo(row) {
      this.companyid = row.companyid;
      this.companyname = row.companyname;
      this.checkFlag = true;
    },
    handleSizeChange(val) {
      this.page.pageSize = val;
      this.getData();

    }
  }
}